<template>
	<view class="swiper-wrap">
		<swiper
			class="swiper"
			:indicator-dots="true"
			:autoplay="true"
			:interval="3000"
			:duration="1000"
			:circular="true"
		>
			<swiper-item v-for="(item, index) in banners" :key="item.pic">
				<image class="swiper-item" :src="utils.picPath(item.pic)" mode="scaleToFill"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
export default {
	name: 'mySwiper',
	props: {
		banners: {
			type: Array,
			default: () => {
				return [
					{
						pic: '/Uploads/2020-07-27/5f1e2c70a35c6.png',
						url:
							'http://wx.daoyoupeixun.cn/app/index.php?i=1&amp;c=entry&amp;m=ewei_shopv2&amp;do=mobile&amp;r=goods.'
					},
					{
						pic: '/Uploads/2020-05-21/5ec63d1d49fad.gif',
						url:
							'http://wx.daoyoupeixun.cn/app/index.php?i=1&amp;c=entry&amp;m=ewei_shopv2&amp;do=mobile&amp;r=goods.detail&amp;id=84'
					}
				];
			}
		}
	}
};
</script>

<style lang="less" scoped>
.swiper-wrap {
	background-color: gray;
	width: 100%;
	.swiper {
		height: 430rpx;
	}
	.swiper-item {
		width: 100%;
		height: 100%;
	}
}
</style>
